//
//  GCMAddNewLXJLViewController.m
//  GeeCityManager
//
//  Created by 聚城科技 on 16/3/23.
//  Copyright © 2016年 聚城科技. All rights reserved.
//

#import "GCMAddNewLXJLViewController.h"

@interface GCMAddNewLXJLViewController ()

@end

@implementation GCMAddNewLXJLViewController{

    UILabel *_lxrLabel;
    UITextField *_textF;
    UILabel *label;
    UIButton *_Btn;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createUI];
}


-(void)createUI{

    _lxrLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20 + 64, SCREEN_WIDTH - 20, 30)];
    _lxrLabel.text = [NSString stringWithFormat:@"联系人：%@",self.contact];
    _lxrLabel.textColor = [UIColor lightGrayColor];
    [self.view addSubview:_lxrLabel];
    
    _textF = [[UITextField alloc]initWithFrame:CGRectMake(20, 60+ 64, SCREEN_WIDTH - 40, 40)];
    _textF.placeholder = @"请填写沟通内容";
    _textF.tag = 4431;
    [self.view addSubview:_textF];
    
    label = [[UILabel alloc]initWithFrame:CGRectMake(20, 100+ 64, SCREEN_WIDTH - 40, 2)];
    label.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:label];
    
    _Btn = [[UIButton alloc]initWithFrame:CGRectMake(30, 120+ 64, SCREEN_WIDTH - 60, 40)];
    _Btn.backgroundColor = [UIColor colorWithRed:0 green:0.67 blue:0.65 alpha:1];
    [_Btn setTitle:@"提交" forState:UIControlStateNormal];
    [_Btn addTarget:self action:@selector(onSubmitCilck) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_Btn];
}

-(void)onSubmitCilck{
    
    NSMutableDictionary *parameters = [[NSMutableDictionary alloc]init];
    parameters[@"taskId"] = self.idd;
    parameters[@"content"] = _textF.text;
    parameters[@"contact"] = self.contact;
    parameters[@"createName"] = [GCMUserInfo instance].realName;


    [GCMTaskHttpRequst postDataWithParmerts:parameters WithUrl:TASKADDCONTACT_URL Success:^(id obj, NSError *err) {
       // NSLog(@"测试是否成功%@",obj);
    }];
    [self.navigationController popViewControllerAnimated:YES];
}






-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    UITextField * textfield = (UITextField *)[self.view viewWithTag:4431];
    //点任何空白区域才能收下键盘
    [textfield resignFirstResponder];
    //    [self.view endEditing:YES];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
